# selection.Selection.[Symbol.iterator]

- **Module:** selection.Selection
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/selection.ts#L362
- **Page:** https://libtmux.org/en/ts/latest/reference/selection-selection-[symbol-iterator]/

```
selection.Selection.[Symbol.iterator]() -> IterableIterator<Model>
```

Iterate in tmux's own order.

Each call returns a fresh iterator, so a selection can be walked more than
once: spread it and then loop it, and the second pass is not empty. This is
what `for...of`, spread and destructuring all go through.

## Example

```ts
for (const window of snapshot.windows) window.name;
[...snapshot.windows].length === snapshot.windows.length;
```
